<?php
define("DBHOST","localhost:3306");
define("DBUSER","root");
define("DBPASSWD","root");
define("DBNAME","job");

$connection = @mysql_connect(DBHOST,DBUSER,DBPASSWD) or die("数据库连接失败:".mysql_error()."<br/>");

@mysql_query("set names utf8") or die("设置编码格式失败：".mysql_error()."<br/>");

@mysql_select_db(DBNAME) or die("选择数据库失败：".mysql_error()."<br/>");



// 创建学生信息表
$createstudents = "create table if not exists students(id int not null auto_increment primary key,stu_number varchar(40),stu_password varchar(60),stu_name varchar(30),
	school varchar(60),stu_phone varchar(30),stu_email varchar(60),stu_province varchar(30),stu_city varchar(30),stu_county varchar(30),
	stu_sex varchar(10),name varchar(30),stuper_signature varchar(300),stu_touxiang varchar(100),stu_insertdate datetime)";
@mysql_query($createstudents) or die("创建学生信息表失败：".mysql_error()."<br/>");

// 创建老师信息表
$createteachers = "create table if not exists teachers(id int not null auto_increment primary key,tea_number varchar(40),tea_password varchar(60),tea_name varchar(30),
	job_company varchar(60),tea_phone varchar(30),tea_email varchar(60),address varchar(100),tea_province varchar(30),tea_city varchar(30),tea_county varchar(30),
	tea_sex varchar(10),postal_code varchar(30),teaper_signature varchar(300),tea_touxiang varchar(100),tea_insertdate datetime)";
@mysql_query($createteachers) or die("创建老师信息表失败：".mysql_error()."<br/>");

// 创建管理员信息表
$createadminfos = "create table if not exists adminfos(id int not null auto_increment primary key,adm_number varchar(40),adm_password varchar(60))";
@mysql_query($createadminfos) or die("创建管理员信息表失败：".mysql_error()."<br/>");

// 创建课程信息表
$createcourses = "create table if not exists courses(id int not null auto_increment primary key,tea_number varchar(40),one_subject varchar(30),two_subject varchar(30),
	course_name varchar(60),tea_phone varchar(20),tea_email varchar(60),open_course varchar(5),course_img varchar(100),course_credit varchar(10),course_period varchar(10),
	course_type varchar(30),course_summary varchar(300),insertdate datetime)";
@mysql_query($createcourses) or die("创建课程信息表失败：".mysql_error()."<br/>");

// 创建作业信息表
// $createtasks = "create "
?>